<?php
/**
 * qrcode.php 扫一扫
 *
 * @author camfee <camfee@foxmail.com>
 * @date   17-12-28
 *
 */
require_once('../common.inc.php');

use MobileApi\ApiBase;

class qrcode extends lib\core\Action
{
    public function doDefault()
    {
        // type 1:活动 2：电子券 3：会员价 4：用户金果榜领奖
        $type = intval($_GET['type']);
        $id = intval($_GET['id']);
        $hash = trim($_GET['hash']);
        $time = $_GET['time'];

        $data = [];
        switch ($type) {
            case 1:
                $data = [
                    'Id' => $id,
                    'Type' => $type,
                    'Tab' => '领取奖品',
                    'ActiveName' => '活动标题最多两行超过打点活动标题最多两行超过打点',
                    'ImgUrl' => '',
                ];
                break;
            case 2:
                $data = [
                    'Id' => $id,
                    'Type' => $type,
                    'Tab' => '验证电子券',
                    'CouponName' => '电子券标题如海尔线下商场电子券最多两行超过打点',
                    'CashNum' => 500,
                    'ValidText' => '2017.12.1-2018.2.1期间使用',
                ];
                break;
            case 3:
                $data = [
                    'Id' => $id,
                    'Type' => $type,
                    'Tab' => '新会员认证',
                    'ShopName' => '鄂尔多斯旗舰店店铺名最多三行鄂尔多斯旗舰店店铺名最多三行',
                    'ImgUrl' => '',
                ];
                break;
            case 4:
                $data = [
                    'Id' => $id,
                    'Type' => $type,
                    'Tab' => '领取奖品',
                    'ShopName' => '金果3月［用户金果榜］的第三名',
                ];
                break;
        }

        ApiBase::output(200, $data);
    }
}
$app->run();